/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*                                                                  *
*        *************************************************         *
*        *©2021-2027 HT Corporation All rights reserved *          *
*        *************************************************         *
*                                                                  *
* FileName    : h_register.h                                       *
*                                                                  *
* Author      : linus                                              *
*                                                                  *
* Email       : luoyaojun@haitutech.com                            *
*                                                                  *
* Date        : 2022-8-8                                           *
*                                                                  *
* Description :                                                    *
*                                                                  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H_REGISTER_H
#define __H_REGISTER_H

#include "h_comm.h"


#define HT_MPP_HANDLE(x)	ht_registed_ops(x)


struct ht_modules{

	HT_MOD_ID module_id;
	
	HT_HANDLE module_priv;

	HT_HANDLE *config;
	
	const char *suffix;
};

extern struct ht_modules g_modules[HT_ID_BUTT];

inline HT_HANDLE __inline ht_registed_ops(HT_MOD_ID id)
{
	if (id >0 && id < HT_ID_BUTT)
	{
		return g_modules[id].module_priv;
	}
	
	return NULL;
}

HT_S32 ht_register_modules(HT_MOD_ID id, HT_HANDLE priv);
HT_VOID ht_registed_set_suffix(HT_MOD_ID id, const char *suffix);
HT_VOID ht_registed_set_config(HT_MOD_ID id, HT_HANDLE config);


#endif
